package secondriver.springsubway.example.rpv.constraint;

import net.sf.oval.ConstraintTarget;
import net.sf.oval.configuration.annotation.Constraint;
import net.sf.oval.configuration.annotation.Constraints;

import java.lang.annotation.*;

/**
 * Created by ZhangXiao on 2015/6/11.
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD})
@Constraint(
        checkWith = StartWithCheck.class
)
public @interface StartWith {

    ConstraintTarget[] appliesTo() default {ConstraintTarget.VALUES};

    String errorCode();

    String message();

    String[] profiles() default {};

    int severity() default 0;

    String target() default "";

    String value();

    String when() default "";

    @Documented
    @Retention(RetentionPolicy.RUNTIME)
    @Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD})
    @Constraints
    public @interface List {
        StartWith[] value();

        String when() default "";
    }
}
